<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class ArticleRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'category_id'=>'required|integer|exists:category,id|max:1000',
			'title'=>'required|max:50|min:1',
			'author'=>'required|max:20',
			'sort'=>'required|between:0,100',
			'tag'=>'string|max:80',
			'thumb'=>'image',
			'is_show'=>[
				Rule::in(['0', '1']),
				],
			'content'=>'required|max:5000',
        ];
    }
}
